/*
 ============================================================================
 Name		: RtSingleTimer.h
 Author	  : hou maoqing
 Version	 : 1.0
 Copyright   : Copyright (c) Hou maoqing 2008
 houmqing@sohu.com
 Description : CRtSingleTimer declaration
 ============================================================================
 */

#ifndef RtSingleTimer_H
#define RtSingleTimer_H

#include <e32base.h>	// For CActive, link against: euser.lib
#include <e32std.h>		// For RTimer, link against: euser.lib
#include "RtObject.h"

class MRtSingleTimerObserver
	{
public:
	virtual void TimerFinished(TInt nID)=0;
	};

class CRtSingleTimer : public CActive ,public CRtObject
	{
public:
	CRtSingleTimer(MRtSingleTimerObserver& rObserver,int nID);
	virtual ~CRtSingleTimer();
	
public:
	int GetID();
	void After(TTimeIntervalMicroSeconds32 aDelay);

private:
	void ConstructL();
	
	//inherit from CActive
	void RunL();
	void DoCancel();
	TInt RunError(TInt aError);

private:
	MRtSingleTimerObserver& m_rObserver;
	int m_nID;
	
	RTimer iTimer; // Provides async timing service

	};

#endif // RtSingleTimer_H
